package cn.com.wblog.pojo;

import java.sql.Timestamp;

import org.nutz.dao.entity.annotation.*;

@Table("wb_article")
public class Article {
	@Column
	@Id
	private int id;
	@Column
	private int userId;
	@Column
	private int typeId;
	@Column
	private String title;
	@Column
	private Timestamp postTime;
	@Column
	private Timestamp updateTime;
	@Column
	private int state;
	@One(target = User.class, field = "userId")
	private User user;
	@One(target = ArticleType.class, field = "typeId")
	private ArticleType type;
	@One(target = ArticleContent.class, field = "id")
	private ArticleContent content;
	
	public String toString() {
		return "id: " + id + ", title: " + title + ", userId: " + userId + ", postTime: " + postTime + ", updateTime: " + updateTime;
	}
	public Article() {
		
	}
	public Article(int userId, int typeId, String title) {
		this.userId = userId;
		this.typeId = typeId;
		this.title = title;
	}
	
	public ArticleContent getContent() {
		return content;
	}
	public void setContent(ArticleContent content) {
		this.content = content;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public ArticleType getType() {
		return type;
	}
	public void setType(ArticleType type) {
		this.type = type;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public int getTypeId() {
		return typeId;
	}
	public void setTypeId(int typeId) {
		this.typeId = typeId;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Timestamp getPostTime() {
		return postTime;
	}
	public void setPostTime(Timestamp postTime) {
		this.postTime = postTime;
	}
	public Timestamp getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}
	
}
